package com.wind.databasecreater;

import java.util.ArrayList;

public class DataUtils {
	String TAG = "DataUtils";
	static String split1 = "$";
	static String split2 = "#";

	public static ArrayList<String> region = new ArrayList<String>();
	public static ArrayList<String> number = new ArrayList<String>();
	public static ArrayList<String> center = new ArrayList<String>();

	private static void splitData() {
		String data = Data.datas;
		String[] dataSplited = data.split(split1);
		String str;
		for (int i = 0; i < dataSplited.length; i++) {
			str = dataSplited[i];
			if (str.startsWith("Region")) {
				region.add(str);
				number.add(dataSplited[++i]);
			}
			if (str.startsWith("Center")) {
				center.add(str);
			}
		}
	}

	public static int getRegion() {
		if (region.size() == 0) {
			splitData();
		}
		return region.size();
	}

	public static int getNumber() {
		if (number.size() == 0) {
			splitData();
		}
		return number.size();
	}
}
